package com.cskaoyan.controller.stat;

import com.cskaoyan.model.vo.BaseRespVo;
import com.cskaoyan.model.vo.stat.StatGoodsVO;
import com.cskaoyan.model.vo.stat.StatOrderVO;
import com.cskaoyan.model.vo.stat.StatUserVO;
import com.cskaoyan.service.stat.StatService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

/**
 * @program: project-market
 * @description: 统计报表
 * @author: shiyue
 * @create: 2021/12/1 9:21
 **/
@RestController
@RequestMapping("admin/stat")
public class StatController {

    @Autowired
    StatService statService;

    @RequiresPermissions("admin:stat:user")
    @RequestMapping("user")
    public BaseRespVo getUser() {
        StatUserVO userVO=statService.getUser();
        return BaseRespVo.ok(userVO);
    }

    @RequiresPermissions("admin:stat:order")
    @RequestMapping("order")
    public BaseRespVo getOrder() {
        StatOrderVO userVO=statService.getOrder();
        return BaseRespVo.ok(userVO);
    }

    @RequiresPermissions("admin:stat:goods")
    @RequestMapping("goods")
    public BaseRespVo getGoods() {
        StatGoodsVO userVO=statService.getGoods();
        return BaseRespVo.ok(userVO);
    }
}
